<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 5.4.2">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha256-HtsXJanqjKTc8vVQjO4YMhiqFoXkfBsjBWcX91T1jr8=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"xiaoqingming18.github.io","root":"/","images":"/images","scheme":"Muse","darkmode":false,"version":"8.15.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/js/config.js"></script>

    <meta name="description" content="清除浮动带来的影响假设有一个父盒子，内部有一个子元素，子元素设置了右浮动，此时父盒子高度会因为浮动的影响变成0，可以采用给父级盒子添加clear:after的CSS样式来清除内部元素浮动带来的影响，看下面的例子： 1234567&lt;div class&#x3D;&#39;box clear&#39;&gt;  &lt;ul&gt;    &lt;li&gt;第一个&lt;&#x2F;li&gt;    &lt;li&gt;第二个">
<meta property="og:type" content="article">
<meta property="og:title" content="CSS：块级元素细节">
<meta property="og:url" content="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/index.html">
<meta property="og:site_name" content="鸣蜩十七">
<meta property="og:description" content="清除浮动带来的影响假设有一个父盒子，内部有一个子元素，子元素设置了右浮动，此时父盒子高度会因为浮动的影响变成0，可以采用给父级盒子添加clear:after的CSS样式来清除内部元素浮动带来的影响，看下面的例子： 1234567&lt;div class&#x3D;&#39;box clear&#39;&gt;  &lt;ul&gt;    &lt;li&gt;第一个&lt;&#x2F;li&gt;    &lt;li&gt;第二个">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/清除浮动.png">
<meta property="og:image" content="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/垂直导航.png">
<meta property="og:image" content="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/水平导航.png">
<meta property="og:image" content="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/文字显示效果.png">
<meta property="og:image" content="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/首选最小宽度.png">
<meta property="article:published_time" content="2023-04-26T10:59:34.000Z">
<meta property="article:modified_time" content="2023-05-04T13:25:32.309Z">
<meta property="article:author" content="鸣蜩十七">
<meta property="article:tag" content="-前端 -CSS">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/清除浮动.png">


<link rel="canonical" href="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/","path":"2023/04/26/CSS：块级元素及自适应布局/","title":"CSS：块级元素细节"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>CSS：块级元素细节 | 鸣蜩十七</title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>

<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; }  .github-emoji > span { position: relative; z-index: 10; }  .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; }  .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">鸣蜩十七</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">鸣蜩十七是和女朋友谈恋爱的日子</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-schedule"><a href="/schedule/" rel="section"><i class="fa fa-calendar fa-fw"></i>日程表</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="fa fa-sitemap fa-fw"></i>站点地图</a></li><li class="menu-item menu-item-commonweal"><a href="/404/" rel="section"><i class="fa fa-heartbeat fa-fw"></i>公益 404</a></li>
  </ul>
</nav>




</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%B8%85%E9%99%A4%E6%B5%AE%E5%8A%A8%E5%B8%A6%E6%9D%A5%E7%9A%84%E5%BD%B1%E5%93%8D"><span class="nav-text">清除浮动带来的影响</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E7%9B%92%E5%AD%90%E5%85%B7%E4%BD%93%E7%BB%84%E6%88%90%E7%BB%86%E8%8A%82"><span class="nav-text">盒子具体组成细节</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#width-auto%E7%9A%84%E5%85%B7%E4%BD%93%E4%BD%9C%E7%94%A8%E7%BB%86%E8%8A%82"><span class="nav-text">width:auto的具体作用细节</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%B1%9E%E6%80%A7-width-auto"><span class="nav-text">属性 - width:auto</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%A4%96%E9%83%A8%E5%B0%BA%E5%AF%B8%E4%B8%8E%E6%B5%81%E4%BD%93%E7%89%B9%E6%80%A7"><span class="nav-text">外部尺寸与流体特性</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%B5%81%E5%8A%A8%E6%80%A7"><span class="nav-text">流动性</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%AE%BD%E5%BA%A6"><span class="nav-text">格式化宽度</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%86%85%E9%83%A8%E5%B0%BA%E5%AF%B8%E4%B8%8E%E6%B5%81%E4%BD%93%E7%89%B9%E6%80%A7"><span class="nav-text">内部尺寸与流体特性</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%8C%85%E8%A3%B9%E6%80%A7"><span class="nav-text">包裹性</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%A6%96%E9%80%89%E6%9C%80%E5%B0%8F%E5%AE%BD%E5%BA%A6"><span class="nav-text">首选最小宽度</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%9C%80%E5%A4%A7%E5%AE%BD%E5%BA%A6"><span class="nav-text">最大宽度</span></a></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#width%E5%90%AB%E5%85%B7%E4%BD%93%E6%95%B0%E5%80%BC%E6%97%B6%E7%9A%84%E5%85%B7%E4%BD%93%E4%BD%9C%E7%94%A8%E7%BB%86%E8%8A%82"><span class="nav-text">width含具体数值时的具体作用细节</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%B5%81%E5%8A%A8%E6%80%A7%E4%B8%A2%E5%A4%B1"><span class="nav-text">流动性丢失</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%8E%E7%8E%B0%E5%AE%9E%E4%B8%96%E7%95%8C%E8%A1%A8%E7%8E%B0%E4%B8%8D%E4%B8%80%E8%87%B4"><span class="nav-text">与现实世界表现不一致</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E8%A7%A3%E5%86%B3width%E5%92%8Cpadding%E3%80%81margin%E7%AD%89%E5%B1%9E%E6%80%A7%E4%B8%8D%E8%83%BD%E5%85%B1%E5%AD%98%E9%97%AE%E9%A2%98"><span class="nav-text">解决width和padding、margin等属性不能共存问题</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#CSS%E6%B5%81%E4%BD%93%E5%B8%83%E5%B1%80%E4%B8%8B%E7%9A%84%E5%AE%BD%E5%BA%A6%E5%88%86%E7%A6%BB%E5%8E%9F%E5%88%99"><span class="nav-text">CSS流体布局下的宽度分离原则</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%94%B9%E5%8F%98width%E4%BD%9C%E7%94%A8%E7%BB%86%E8%8A%82%E7%9A%84box-sizing"><span class="nav-text">改变width作用细节的box-sizing</span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">鸣蜩十七</p>
  <div class="site-description" itemprop="description">记录我的学习、生活和恋爱日常</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">43</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">37</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://xiaoqingming18.github.io/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="鸣蜩十七">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="鸣蜩十七">
      <meta itemprop="description" content="记录我的学习、生活和恋爱日常">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="CSS：块级元素细节 | 鸣蜩十七">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          CSS：块级元素细节
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-04-26 18:59:34" itemprop="dateCreated datePublished" datetime="2023-04-26T18:59:34+08:00">2023-04-26</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-05-04 21:25:32" itemprop="dateModified" datetime="2023-05-04T21:25:32+08:00">2023-05-04</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%89%8D%E7%AB%AF/" itemprop="url" rel="index"><span itemprop="name">-前端</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="清除浮动带来的影响"><a href="#清除浮动带来的影响" class="headerlink" title="清除浮动带来的影响"></a>清除浮动带来的影响</h1><p>假设有一个父盒子，内部有一个子元素，子元素设置了右浮动，此时父盒子高度会因为浮动的影响变成0，可以采用给父级盒子添加<code>clear:after</code>的CSS样式来清除内部元素浮动带来的影响，看下面的例子：</p>
<figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">'box clear'</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span>第一个<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span>第二个<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span>第三个<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.box</span> {</span><br><span class="line">  <span class="attribute">background</span>: green;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-tag">ul</span> {</span><br><span class="line">  <span class="attribute">float</span>: right;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.clear</span><span class="selector-pseudo">:after</span> {</span><br><span class="line">  <span class="attribute">content</span>: <span class="string">''</span>;</span><br><span class="line">  <span class="attribute">display</span>: block;</span><br><span class="line">  <span class="attribute">clear</span>: both;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-tag">li</span> {</span><br><span class="line">  <span class="attribute">height</span>: <span class="number">30vh</span>;</span><br><span class="line">  <span class="attribute">list-style</span>: none;</span><br><span class="line">  <span class="attribute">display</span>: inline-block;</span><br><span class="line">  <span class="attribute">background</span>: pink;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<p>效果如下：(注意要使用*通配符选择器将网页默认的<code>margin</code>与<code>padding</code>设置为0)</p>
<p><img src="/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/清除浮动.png" alt="清除浮动效果图"></p>
<h1 id="盒子具体组成细节"><a href="#盒子具体组成细节" class="headerlink" title="盒子具体组成细节"></a>盒子具体组成细节</h1><p>Html中，每个盒子都由一个外盒子和一个内盒子组成。外盒子负责元素是在一行显示还是换行显示，而内盒子负责宽高和内容显示。这也是为什么<code>display</code>属性为<code>inline-block</code>的盒子既能在一行显示又能设置宽高的原因。</p>
<p>由此我们也知道了，<code>width</code>和<code>height</code>属性是作用在内盒子，也就是<strong>容器盒子</strong>上的。</p>
<h1 id="width-auto的具体作用细节"><a href="#width-auto的具体作用细节" class="headerlink" title="width:auto的具体作用细节"></a>width:auto的具体作用细节</h1><h2 id="属性-width-auto"><a href="#属性-width-auto" class="headerlink" title="属性 - width:auto"></a>属性 - width:auto</h2><p><code>auto</code>是<code>width</code>属性的默认值，也即不设置<code>width</code>属性时，默认是<code>width: auto</code>，此时会有以下几种表现：</p>
<ol>
<li>流动性：块级元素宽度默认为父级容器的100%。</li>
<li>包裹性：浮动、绝对定位、<code>inline-block</code>元素会将宽度收缩到完全包裹子元素，下面会细说包裹性。</li>
<li>收缩到最小：</li>
<li>超出容器限制：</li>
</ol>
<p>下面我们在<strong>外部尺寸</strong>和<strong>内部尺寸</strong>的知识点里来具体说说上面提到的几种宽度表现。</p>
<h3 id="外部尺寸与流体特性"><a href="#外部尺寸与流体特性" class="headerlink" title="外部尺寸与流体特性"></a>外部尺寸与流体特性</h3><h4 id="流动性"><a href="#流动性" class="headerlink" title="流动性"></a>流动性</h4><p>首先来看<strong>流动性</strong>，流动性就是块级元素默认会铺满父元素，在不设置<code>width</code>属性或<code>width</code>属性为<code>auto</code>的情况下。</p>
<p>要牢记，表现为外部尺寸的块级元素一旦设置了宽度，流动性就丢失了。流动性，也是指<code>margin/border/padding</code>和<code>content</code>内容区域自动分配水平空间的机制。</p>
<p>我们来看一个垂直导航的例子：</p>
<figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">'leftBar'</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"nav"</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">""</span>&gt;</span>导航1<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">""</span>&gt;</span>导航2<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">""</span>&gt;</span>导航3<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">* {</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.leftBar</span> {</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">200px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.nav</span> {</span><br><span class="line">  <span class="attribute">background-color</span>: <span class="number">#cd0000</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.nav</span> <span class="selector-tag">a</span> {</span><br><span class="line">  <span class="attribute">text-decoration</span>: none;</span><br><span class="line">  <span class="attribute">display</span>: block;</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span> <span class="number">10px</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">9px</span> <span class="number">10px</span>;</span><br><span class="line">  <span class="attribute">border-bottom</span>: <span class="number">1px</span> solid <span class="number">#b70000</span>;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#fff</span>;</span><br><span class="line">}</span><br><span class="line"></span><br></pre></td></tr></tbody></table></figure>
<p>效果如下：</p>
<p><img src="/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/垂直导航.png" alt="垂直导航效果图"></p>
<p>我们没有给<code>display</code>属性为<code>block</code>的<code>a</code>标签指定宽度，所以它会自动铺满它的容器（父元素<code>div.nav</code>），而元素<code>div.nav</code>也没有设置<code>width</code>宽度属性，所以会继续铺满它的父元素<code>div.leftBar</code>，我们给<code>div.leftBar</code>设置了<code>width</code>为<code>200px</code>，所以最终的效果就如上图所示。</p>
<p>上面的例子很好地体现了<strong>流动性</strong>，块级元素没有设置<code>width</code>属性或<code>width</code>属性为<code>auto</code>时会铺满父元素。</p>
<h4 id="格式化宽度"><a href="#格式化宽度" class="headerlink" title="格式化宽度"></a>格式化宽度</h4><p>对于<strong>非替换元素</strong>，当<code>left/right</code>或<code>top/bottom</code>对立方位的属性值同时存在时，元素的宽度表现为<strong>格式化宽度</strong>，也就是该元素的宽度大小相对于最近的==具有定位特性==的祖先元素计算。来看下面的例子：</p>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">div</span> {</span><br><span class="line">    <span class="attribute">position</span>: absolute;</span><br><span class="line">    <span class="attribute">left</span>: <span class="number">20px</span>;</span><br><span class="line">    <span class="attribute">right</span>: <span class="number">20px</span>;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<p>假设该<code>div</code>元素最近的具有定位特性的祖先元素的宽度是1000像素，那么这个<code>div</code>元素的宽度就是960（1000-20-20）像素。</p>
<p>格式化宽度也具有完全的<strong>流体性</strong>，格式化宽度水很深，也很实用，具体会在定位的笔记中说到。</p>
<h3 id="内部尺寸与流体特性"><a href="#内部尺寸与流体特性" class="headerlink" title="内部尺寸与流体特性"></a>内部尺寸与流体特性</h3><p>所谓<strong>内部尺寸</strong>，简单点说就是元素的尺寸由内部的元素决定。当元素里没有内容宽度是0时，该元素应用的就是内部尺寸。</p>
<h4 id="包裹性"><a href="#包裹性" class="headerlink" title="包裹性"></a>包裹性</h4><p>简单来说，<strong>包裹性</strong>就是父元素的宽度会收缩到与内部元素宽度一致。</p>
<p>那么包裹性的条件是什么呢?当元素为<code>absolute、fixed、float、inline-block</code>时就会具有包裹性。（个人猜测，所有能产生<strong>BFC</strong>的元素都具有包裹性。）</p>
<p>应用场景：当遇到内部元素宽度不确定，又需要给外部元素限定宽度时，就可以通过给父元素设置<code>inline-block</code>让父元素宽度自适应子元素宽度。</p>
<p>我们来看一个水平导航的例子：</p>
<figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"nav"</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">""</span>&gt;</span>导航1<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">""</span>&gt;</span>导航2<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">""</span>&gt;</span>导航3<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">* {</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.nav</span> {</span><br><span class="line">  <span class="attribute">display</span>: inline-block;</span><br><span class="line">  <span class="attribute">background-color</span>: <span class="number">#cd0000</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.nav</span> <span class="selector-tag">a</span> {</span><br><span class="line">  <span class="attribute">display</span>: inline-block;</span><br><span class="line">  <span class="attribute">text-decoration</span>: none;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">3px</span> <span class="number">6px</span>;</span><br><span class="line">  <span class="attribute">border-right</span>: <span class="number">2px</span> solid <span class="number">#b70000</span>;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#fff</span>;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<p>效果如下：</p>
<p><img src="/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/水平导航.png" alt="水平导航效果图"></p>
<p>这里给<code>a</code>标签设置<code>inline-block</code>是为了让其上下<code>padding</code>生效，因为内联元素的上下<code>padding</code>与<code>margin</code>是不起作用的。</p>
<p>包裹性对实际开发还有个例子，看下面的需求：</p>
<p>页面某个模块的文字内容是动态的，希望字少时居中显示，字多时居左显示，看下面的代码实现：</p>
<figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"box"</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"content"</span>&gt;</span>文字较少时居中显示<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"box"</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"content"</span>&gt;</span>文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  文字较多时居左显示  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"></span><br></pre></td></tr></tbody></table></figure>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">* {</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.box</span> {</span><br><span class="line">  <span class="attribute">text-align</span>: center;</span><br><span class="line">  <span class="attribute">background-color</span>: red;</span><br><span class="line">  <span class="attribute">margin-top</span>: <span class="number">20px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.content</span> {</span><br><span class="line">  <span class="attribute">display</span>: inline-block;</span><br><span class="line">  <span class="attribute">text-align</span>: left;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<p>效果如下：</p>
<p><img src="/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/文字显示效果.png" alt="文字显示效果图"></p>
<p>这个例子的实现原理很重要：当文字较少时，<code>.content</code>并没有宽高，并且设置了<code>inline-block</code>属性，所以此时它相当于一个行内元素，<code>text-align: left</code>属性对<code>.content</code>不起作用，并且受到<code>.box</code>的<code>text-align: center</code>影响居中显示文本。当文字变多后，<code>.content</code>会宽度超过<code>.box</code>宽度会自动换行，此时它有了宽高，<code>text-align: left</code>属性开始对<code>.content</code>起作用，使得文本居左显示。</p>
<h4 id="首选最小宽度"><a href="#首选最小宽度" class="headerlink" title="首选最小宽度"></a>首选最小宽度</h4><p><strong>首选最小宽度</strong>就是指元素最适合的最小宽度，当容器宽度为0时，内部<code>inline-block</code>元素的宽度不会是0，而是根据该元素内容决定的首选最小宽度。具体规则如下：</p>
<ol>
<li>汉字最小宽度为每个汉字的宽度。</li>
<li>西方文字最小宽度为连续的英文字符单元的宽度，而终止与非英文字符，也就是碰到非英文字符就换行。</li>
<li>类似图片的替换元素最小宽度就是该元素内容本身。</li>
</ol>
<p>下面来看首选最小宽度应用的一个例子：</p>
<figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"ao"</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.ao</span> {</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">0</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.ao</span><span class="selector-pseudo">:before</span> {</span><br><span class="line">  <span class="attribute">content</span>: <span class="string">"love你love"</span>;</span><br><span class="line">  <span class="attribute">outline</span>: <span class="number">2px</span> solid <span class="number">#cd0000</span>;</span><br><span class="line">  <span class="comment">/*color: #fff;*/</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<p>效果如下：</p>
<p><img src="/2023/04/26/CSS%EF%BC%9A%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0%E5%8F%8A%E8%87%AA%E9%80%82%E5%BA%94%E5%B8%83%E5%B1%80/首选最小宽度.png" alt="首选最小宽度效果图"></p>
<p>将文字颜色改为白色即可彻底实现画出“凹”的形状。</p>
<h4 id="最大宽度"><a href="#最大宽度" class="headerlink" title="最大宽度"></a>最大宽度</h4><p><strong>最大宽度</strong>就是元素可以有的最大宽度。如果内部没有块级元素或块级元素没有设置宽度，则最大宽度就是==最大的连续内联盒子的宽度==。</p>
<h1 id="width含具体数值时的具体作用细节"><a href="#width含具体数值时的具体作用细节" class="headerlink" title="width含具体数值时的具体作用细节"></a>width含具体数值时的具体作用细节</h1><p>内在盒子又被分为<code>content box</code>、<code>padding box</code>、<code>border box</code>和<code>margin box</code>四个盒子。其中<code>margin box</code>作用不大，可以忽略，并且盒子本身的宽度不受其影响。</p>
<p><code>width</code>属性赋的值是作用在<code>content box</code>上的，来看下面的例子：</p>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">div</span> {<span class="attribute">width</span>: <span class="number">100px</span>; <span class="attribute">padding</span>: <span class="number">20px</span>; <span class="attribute">border</span>: <span class="number">20px</span> solid;}</span><br></pre></td></tr></tbody></table></figure>
<p>上面的例子的<code>width: 100px</code>就是作用在内容盒子<code>content box</code>上的，最终盒子的尺寸应为100+20×2+20×2=180px。</p>
<p>上面所说的宽度表现有不合理的地方，主要有下面说的两点。</p>
<h2 id="流动性丢失"><a href="#流动性丢失" class="headerlink" title="流动性丢失"></a>流动性丢失</h2><p>一旦为<code>width</code>设定了具体数值，元素的流动性就会消失。</p>
<h2 id="与现实世界表现不一致"><a href="#与现实世界表现不一致" class="headerlink" title="与现实世界表现不一致"></a>与现实世界表现不一致</h2><p>设计网页时，我们希望某个元素的宽度是多少，但是给它设置<code>margin</code>、<code>padding</code>和<code>border</code>属性后，元素的实际宽度就会变大，这与我们想要的不一致。</p>
<p>下面我们介绍如何解决上面的问题。</p>
<h1 id="解决width和padding、margin等属性不能共存问题"><a href="#解决width和padding、margin等属性不能共存问题" class="headerlink" title="解决width和padding、margin等属性不能共存问题"></a>解决width和padding、margin等属性不能共存问题</h1><h2 id="CSS流体布局下的宽度分离原则"><a href="#CSS流体布局下的宽度分离原则" class="headerlink" title="CSS流体布局下的宽度分离原则"></a>CSS流体布局下的宽度分离原则</h2><p><strong>宽度分离原则</strong>，就是CSS中的<code>width</code>属性不与影响宽度的<code>padding</code>/<code>border</code>（有时也包括<code>margin</code>）属性共存。</p>
<p>那么我们同时需要设置<code>width</code>和<code>padding/border/margin</code>属性时该怎么办呢？采用分离原则，<code>width</code>独立占用一层标签，<code>padding</code>、<code>margin</code>、<code>border</code>利用流动性在内部自适应呈现。</p>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.father</span> {</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">180px</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-class">.son</span> {</span><br><span class="line">    <span class="attribute">margin</span>: <span class="number">0</span> <span class="number">20px</span>;</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">20px</span>;</span><br><span class="line">    <span class="attribute">border</span>: <span class="number">1px</span> solid;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<h2 id="改变width作用细节的box-sizing"><a href="#改变width作用细节的box-sizing" class="headerlink" title="改变width作用细节的box-sizing"></a>改变width作用细节的box-sizing</h2><p><code>box-sizing</code>属性可以改变<code>width</code>属性作用在哪一层盒子上，但遗憾的是，全线支持的只有改变到<code>border box</code>上：</p>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.box</span> {<span class="attribute">box-sizing</span>: border-box}</span><br></pre></td></tr></tbody></table></figure>
<p>当遇到需要<code>margin</code>的布局时，<code>box-sizing: border-box</code>也无用。</p>
<p>从上面看，<strong>宽度分离原则十分重要</strong>！</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E5%89%8D%E7%AB%AF-CSS/" rel="tag"># -前端 -CSS</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2023/04/25/SqlServer-%E5%88%9B%E5%BB%BA%E7%B4%A2%E5%BC%95/" rel="prev" title="SqlServer:创建索引">
                  <i class="fa fa-chevron-left"></i> SqlServer:创建索引
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2023/04/28/java%EF%BC%9A%E5%BC%82%E5%B8%B8%E7%B1%BB%E4%B8%8E%E6%8D%95%E8%8E%B7%E5%BC%82%E5%B8%B8/" rel="next" title="Java：异常类与捕获异常">
                  Java：异常类与捕获异常 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">鸣蜩十七</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script>

  




  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>



</body>
</html>
